var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, n, o) {
    var i, c = arguments.length, a = c < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, n) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(t, e, n, o); else for (var r = t.length - 1; 0 <= r; r--) (i = t[r]) && (a = (c < 3 ? i(a) : 3 < c ? i(e, n, a) : i(e, n)) || a);
    return 3 < c && a && Object.defineProperty(e, n, a), a;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("BaseView"), s = e("NativeAdTimeView"), c = e("MyButton"), l = e("WebManager"), d = e("VideoAdManager"), u = cc._decorator, p = u.ccclass, h = u.property, f = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.viewname = "", t.btnname = "", t.myButton = null, t;
    }
    return i(t, e), t.prototype.onLoad = function() {
        this.myButton && (this.myButton.viewname = this.viewname, this.myButton.btnname = this.btnname, 
        this.myButton.init(this.text));
    }, t.prototype.onEnable = function() {
        cc.systemEvent.on(this.text, this.callback, this);
    }, t.prototype.onDisable = function() {
        cc.systemEvent.off(this.text, this.callback, this);
    }, t.prototype.pushEvent = function(t) {
        l.default.getInstance().sentLog("点击" + this.viewname + "界面" + t + "按键");
    }, t.prototype.delayBtn = function(t) {
        var e, n, o = this;
        void 0 === t && (t = this.myButton), d.default.getInstance().check(this.text) ? (t.getComponent(cc.Button).interactable = !0, 
        t.init(null, null, c.BtnBgType.GREEN)) : (t.getComponent(cc.Button).interactable = !1, 
        (n = (e = new cc.Node("timeLabel").addComponent(cc.Label)).node.addComponent(s.default)).tag = this.text, 
        n.title = "下次领取：", n.timeLabel = e, n.callback = function() {
            o.delayBtn(t);
        }, e.node.setPosition(cc.v2(0, -10)), e.node.parent = t.node, e.fontSize = 25, t.init(null, null, c.BtnBgType.GRAY, c.BtnIconType.NONE));
    }, t.prototype.callback = function() {}, a([ h ], t.prototype, "viewname", void 0), 
    a([ h ], t.prototype, "btnname", void 0), a([ h(c.default) ], t.prototype, "myButton", void 0), 
    a([ p ], t);
}(r.default);

n.default = f;